<%@ page import="com.xszx.entity.TUser" %><%--
  Created by IntelliJ IDEA.
  User: 32312
  Date: 2024/1/9
  Time: 9:54
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%
    TUser user = (TUser)request.getSession().getAttribute("user");
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="/resource/materialize/css/materialize.min.css" media="screen,projection" />
    <!-- Bootstrap Styles-->
    <link href="/resource/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/resource/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/resource/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/resource/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="/resource/js/Lightweight-Chart/cssCharts.css">
    <script src="/resource/js/jquery-1.7.1.js"></script>
</head>
<body>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand waves-effect waves-dark" href="/jsp/index.jsp"><i class="large material-icons">insert_chart</i> <strong>TRACK</strong></a>

            <div id="sideNav" href=""><i class="material-icons dp48">toc</i></div>
        </div>

        <ul class="nav navbar-top-links navbar-right">
            <li><a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b>${user.username}</b></a></li>
        </ul>
    </nav>
    <!-- Dropdown Structure -->
    <ul id="dropdown1" class="dropdown-content">
        <li><a href="/jsp/form.jsp"><i class="fa fa-user fa-fw"></i> 个人中心</a>
        </li>
        <li><a href="/jsp/personCenter.jsp"><i class="fa fa-bell fa-fw"></i> 个人任务</a>
        </li>
        <li><a href="/jsp/test.jsp" target="_top"><i class="fa fa-sign-out fa-fw"></i> 注销</a>
        </li>
    </ul>
    <ul id="dropdown2" class="dropdown-content w250">
        <li>
            <a href="#">
                <div>
                    <i class="fa fa-comment fa-fw"></i> New Comment
                    <span class="pull-right text-muted small">4 min</span>
                </div>
            </a>
        </li>
        <li class="divider"></li>
        <li>
            <a href="#">
                <div>
                    <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                    <span class="pull-right text-muted small">12 min</span>
                </div>
            </a>
        </li>
        <li class="divider"></li>
        <li>
            <a href="#">
                <div>
                    <i class="fa fa-envelope fa-fw"></i> Message Sent
                    <span class="pull-right text-muted small">4 min</span>
                </div>
            </a>
        </li>
        <li class="divider"></li>
        <li>
            <a href="#">
                <div>
                    <i class="fa fa-tasks fa-fw"></i> New Task
                    <span class="pull-right text-muted small">4 min</span>
                </div>
            </a>
        </li>
        <li class="divider"></li>
        <li>
            <a href="#">
                <div>
                    <i class="fa fa-upload fa-fw"></i> Server Rebooted
                    <span class="pull-right text-muted small">4 min</span>
                </div>
            </a>
        </li>
        <li class="divider"></li>
        <li>
            <a class="text-center" href="#">
                <strong>See All Alerts</strong>
                <i class="fa fa-angle-right"></i>
            </a>
        </li>
    </ul>
    <!--/. NAV TOP  -->
    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">


                <li>
                    <a class="active-menu waves-effect waves-dark" href="/jsp/index.jsp"><i class="fa fa-dashboard"></i> 统计</a>
                </li>

                <li>
                    <a href="#" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>固定资产管理<span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                        <li>
                            <a href="#">资产管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-third-level">
                                <li>
                                    <a href="/jsp/assetTable.jsp">总资产管理</a>
                                </li>
                                <li>
                                    <a href="/jsp/assetFixTable.jsp">维修资产</a>
                                </li>
                                <li>
                                    <a href="/jsp/assetForbiddenTable.jsp">禁用资产</a>
                                </li>
                                <li>
                                    <a href="/jsp/assetFreeTable.jsp">空闲资产</a>
                                </li>
                                <li>
                                    <a href="/jsp/assetScrapTable.jsp">报废资产</a>
                                </li>
                                <li>
                                    <a href="/jsp/assetUsingTable.jsp">使用中资产</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/jsp/recordTable.jsp">合同管理</a>
                        </li>
                        <li>
                            <a href="#">系统管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-third-level">
                                <li>
                                    <a href="/jsp/deptTable.jsp">部门管理</a>
                                </li>
                                <li>
                                    <a href="/jsp/user.jsp">用户管理</a>
                                </li>
                                <li>
                                    <a href="/jsp/roleTable.jsp">角色管理</a>
                                </li>
                                <li>
                                    <a href="/jsp/menuTable.jsp">菜单管理</a>
                                </li>
                            </ul>

                        </li>
                    </ul>
                </li>
                <li>
                    <a href="/jsp/empty.jsp" class="waves-effect waves-dark"><i class="fa fa-fw fa-file"></i> 日志</a>
                </li>
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper" >
        <div class="header">
            <h1 class="page-header">
                个人中心
            </h1>

        </div>

        <div id="page-inner">
            <form >
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-action" style="font-size: 30px">
                            你的信息
                        </div>
                        <div class="card-content">
                            <form class="col s12">
                                <div class="row">
                                    <div class="input-field inline">
                                    <div class="input-field inline" style="width: 300px">
                                        <p for="account"  style="font-size: 20px; position: relative">账号</p>
                                        <input id="account" type="text" class="validate" value="${user.account}" style="font-size: 20px" readonly>
                                    </div>
                                    </div>
                                    <div class="input-field inline">
                                    <div class="input-field inline" style="width: 300px">
                                        <p for="phone"  style="font-size: 20px; position: relative">电话</p>
                                        <input id="phone" type="text" class="validate" value="${user.phone}"  style="font-size: 20px">

                                    </div>
                                    </div>
                                </div>
                                <div class="row">
                                <div class="input-field inline">
                                    <div class="input-field inline" style="width: 300px">
                                        <p for="username"  style="font-size: 20px; position: relative">姓名</p>
                                        <input  id="username" type="text" class="validate" value="${user.username}"  style="font-size: 20px">
                                    </div>
                                </div>
                                <div class="input-field inline">
                                    <div class="input-field inline" style="width: 300px">
                                        <p for="idcard"  style="font-size: 20px; position: relative">身份证号</p>
                                        <input id="idcard" type="text" class="validate" value="${user.idcard}" style="font-size: 20px">
                                    </div>
                                </div>
                                </div>
                                <div class="row">
                                <div class="input-field inline">
                                    <div class="input-field inline" style="width: 300px">
                                        <p for="email"  style="font-size: 20px; position: relative">Email</p>
                                        <input id="email" type="text" class="validate" value="${user.email}" style="font-size: 20px">
                                    </div>
                                </div>
                                <div class="input-field inline">
                                    <div class="col s12">
                                        <div class="input-field inline" id="sexx" style="width: 300px">
                                            <p for="sex"  style="font-size: 20px; position: relative">性别</p>
                                            <input name="sex" type="radio" id="test5555555555555" value="1" <c:if test="${user.sex}  ==1">selected </c:if>/>
                                                <label for="test5555555555555" style="font-size: 15px">男</label>
                                                <input name="sex" type="radio" id="test100" value="2" <c:if test="${user.sex}==2">selected </c:if>/>
                                                <label for="test100" style="font-size: 15px">女</label>
<%--                                            <input id="sex" type="text" class="validate" value="${user.sex}" style="font-size: 20px">--%>
                                        </div>
                                    </div>
                                </div>
                                </div>
                                <div class="row">
                                <div class="input-field inline">
                                    <div class="col s12">
                                        <div class="input-field inline" style="width: 300px">
                                            <p for="age"  style="font-size: 20px; position: relative">年龄</p>
                                            <input id="age" type="number" min="1" class="validate" value="${user.age}" style="font-size: 20px">
                                        </div>
                                    </div>
                                </div>
                                <div class="input-field inline">
                                    <div class="col s12">
                                        <div class="input-field inline"style="width: 300px">
                                            <p for="address"  style="font-size: 20px; position: relative">地址</p>
                                            <input id="address" type="text" class="validate" value="${user.address}" style="font-size: 20px">
                                        </div>
                                    </div>
                                </div>
                                </div>
                                <button id="button" value="${user.id}">保存<i class="fa fa-user fa-fw"></i></button>
                                <div style="position: relative; left: 1000px;bottom: 400px">
                                    <button type = "button" id="pass" style="width: 180px;height:60px" value="${user.id}">修改密码</button>
                                </div>
                                <tbody id="user"></tbody>
                                <div id="popup" style="display:none; position: fixed;
                                  top: 50%;
                                    left: 50%;
                                    transform: translate(-50%, -50%);
                                    width: 300px;
                                    background-color: #fff;
                                    padding: 20px;
                                    border-radius: 5px;
                                    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);">
                                    <h5>修改密码</h5>
                                        <p for="password" style="font-size: 20px">原密码：</p>
                                        <input type="password" id="password" name="password">
                                        <p for="password" style="font-size: 20px">新密码：</p>
                                        <input type="password" id="confirm" name="password">
                                        <br>
                                        <button  id="s" type="button" value="${user.password}">确定</button>
                                        <button id="p" >取消</button>
                                </div>
                            </form>
                            <script>
                                $.ajax({
                                    url:"/getUserById",
                                    type:"post",
                                    data:{
                                        account:$("#account").val()
                                    },
                                    dataType:"json",
                                    success:function (data) {
                                        $('#user').empty();
                                        document.getElementById("username").value = data.username;
                                        document.getElementById("age").value = data.age;
                                        document.getElementById("phone").value = data.phone;
                                        document.getElementById("idcard").value = data.idcard;
                                        document.getElementById("email").value = data.email;
                                        document.getElementById("address").value = data.address;
                                        document.getElementById("account").value = data.account;
                                        console.log(data)
                                    }
                                })
                                $("#s").click(function () {
                                    var password = $("#password").val();
                                    var confirm = $("#confirm").val();
                                    var pass = $("#s").val();
                                    var idd = $("#pass").val();
                                    if(password!=pass){
                                        alert("原密码错误，请重新输入")
                                    }else{
                                        console.log(confirm)
                                            $.ajax({
                                                    url:"/perfect",
                                                    data:{
                                                        username:$("#username").val(),
                                                        idcard:$("#idcard").val(),
                                                        phone:$("#phone").val(),
                                                        age:$("#age").val(),
                                                        address:$("#address").val(),
                                                        email:$("#email").val(),
                                                        sex:$('[name="sex"]').val(),
                                                        password:confirm,
                                                        id:idd
                                                    },
                                                    type:"post",
                                                    success:function () {
                                                        alert("修改成功")
                                                        location.href="/index.jsp";
                                                    },
                                                }
                                            )
                                    }
                                })
                                var uid = $("#button").val()
                                $("#pass").click(function () {
                                    var popup = document.getElementById("popup");
                                    popup.style.display = "block";
                                })
                                $("#button").click(function () {
                                    $.ajax({
                                        url:"/perfect",
                                        data:{
                                            username:$("#username").val(),
                                            idcard:$("#idcard").val(),
                                            phone:$("#phone").val(),
                                            age:$("#age").val(),
                                            address:$("#address").val(),
                                            email:$("#email").val(),
                                            sex:$('[name="sex"]').val(),
                                            password:$("#s").val(),
                                            id:uid
                                        },
                                        type:"post",
                                        success:function () {


                                            alert("保存成功")
                                        },

                                        }
                                    )
                                })
                            </script>
                            <div class="clearBoth"></div>
                        </div>
                    </div>
                </div>
            </div>
<%--            <div class="row">--%>
<%--                <div class="col-lg-6">--%>
<%--                    <div class="card">--%>
<%--                        <div class="card-action">--%>
<%--                            Basic Form Elements--%>
<%--                        </div>--%>
<%--                        <div class="card-content">--%>
<%--                            <form class="col s12">--%>
<%--                                <div class="row">--%>
<%--                                    <div class="input-field col s6">--%>
<%--                                        <i class="material-icons prefix">account_circle</i>--%>
<%--                                        <input id="icon_prefix" type="text" class="validate">--%>
<%--                                        <label for="icon_prefix">First Name</label>--%>
<%--                                    </div>--%>
<%--                                    <div class="input-field col s6">--%>
<%--                                        <i class="material-icons prefix">phone</i>--%>
<%--                                        <input id="icon_telephone" type="tel" class="validate">--%>
<%--                                        <label for="icon_telephone">Telephone</label>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </form>--%>

<%--                            <form class="col s12">--%>
<%--                                <div class="row">--%>
<%--                                    <div class="input-field col s12">--%>
<%--                                        <input id="emai" type="email" class="validate">--%>
<%--                                        <label for="email" data-error="wrong" data-success="right">Email</label>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </form>--%>

<%--                            <form class="col s12">--%>
<%--                                <div class="row">--%>
<%--                                    <div class="input-field col s12">--%>
<%--                                        <textarea id="textarea1" class="materialize-textarea"></textarea>--%>
<%--                                        <label for="textarea1">Textarea</label>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </form>--%>
<%--                            <form action="#">--%>
<%--                                <div class="file-field input-field">--%>
<%--                                    <div class="btn">--%>
<%--                                        <span>File</span>--%>
<%--                                        <input type="file" multiple>--%>
<%--                                    </div>--%>
<%--                                    <div class="file-path-wrapper">--%>
<%--                                        <input class="file-path validate" type="text" placeholder="Upload one or more files">--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </form>--%>
<%--                            <!-- Switch -->--%>
<%--                            <div class="switch">--%>
<%--                                <label>--%>
<%--                                    Off--%>
<%--                                    <input type="checkbox">--%>
<%--                                    <span class="lever"></span>--%>
<%--                                    On--%>
<%--                                </label>--%>
<%--                            </div>--%>

<%--                            <!-- Disabled Switch -->--%>
<%--                            <div class="switch">--%>
<%--                                <label>--%>
<%--                                    Off--%>
<%--                                    <input disabled type="checkbox">--%>
<%--                                    <span class="lever"></span>--%>
<%--                                    On--%>
<%--                                </label>--%>
<%--                            </div>--%>
<%--                            <div class="clearBoth"></div>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                </div>--%>
<%--                <div class="col-lg-6">--%>
<%--                    <div class="card">--%>
<%--                        <div class="card-action">--%>
<%--                            Basic Form Elements--%>
<%--                        </div>--%>
<%--                        <div class="card-content">--%>

<%--                            <form action="#">--%>
<%--&lt;%&ndash;                                <p>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                    <input name="group1" type="radio" id="test1" />&ndash;%&gt;--%>
<%--&lt;%&ndash;                                    <label for="test1">Red</label>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                </p>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                <p>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                    <input name="group1" type="radio" id="test2" />&ndash;%&gt;--%>
<%--&lt;%&ndash;                                    <label for="test2">Yellow</label>&ndash;%&gt;--%>
<%--&lt;%&ndash;                                </p>&ndash;%&gt;--%>
<%--                                <p>--%>
<%--                                    <input class="with-gap" name="group1" type="radio" id="test3"  />--%>
<%--                                    <label for="test3">Green</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input name="group1" type="radio" id="test4" disabled="disabled" />--%>
<%--                                    <label for="test4">Brown</label>--%>
<%--                                </p>--%>
<%--                            </form>--%>
<%--                            <form action="#">--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" id="test5" />--%>
<%--                                    <label for="test5">Red</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" id="test6" checked="checked" />--%>
<%--                                    <label for="test6">Yellow</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" class="filled-in" id="filled-in-box" checked="checked" />--%>
<%--                                    <label for="filled-in-box">Filled in</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" id="indeterminate-checkbox" />--%>
<%--                                    <label for="indeterminate-checkbox">Indeterminate Style</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" id="test7" checked="checked" disabled="disabled" />--%>
<%--                                    <label for="test7">Green</label>--%>
<%--                                </p>--%>
<%--                                <p>--%>
<%--                                    <input type="checkbox" id="test8" disabled="disabled" />--%>
<%--                                    <label for="test8">Brown</label>--%>
<%--                                </p>--%>


<%--                            </form>--%>

<%--                    </div>--%>
<%--                    <!-- /.row (nested) -->--%>
<%--                </div>--%>
<%--                <!-- /.panel-body -->--%>
<%--            </div>--%>
<%--            <!-- /.col-lg-12 -->--%>
<%--            <footer><p>Copyright &copy; 2016.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p></footer>--%>
<%--        </div>--%>
<%--        <!-- /. PAGE INNER  -->--%>
<%--    </div>--%>
<%--    <!-- /. PAGE WRAPPER  -->--%>
<%--</div>--%>
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="/resource/js/jquery-1.10.2.js"></script>

<!-- Bootstrap Js -->
<script src="/resource/js/bootstrap.min.js"></script>

<script src="/resource/materialize/js/materialize.min.js"></script>

<!-- Metis Menu Js -->
<script src="/resource/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="/resource/js/morris/raphael-2.1.0.min.js"></script>
<script src="/resource/js/morris/morris.js"></script>


<script src="/resource/js/easypiechart.js"></script>
<script src="/resource/js/easypiechart-data.js"></script>

<script src="/resource/js/Lightweight-Chart/jquery.chart.js"></script>

<!-- Custom Js -->
<script src="/resource/js/custom-scripts.js"></script>


</div>

</body>

</html>

